package com.yijianonghu.service.wxwebsite.products.service;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Service;

import com.yijianonghu.dal.model.SysBlog;
import com.yijianonghu.dal.model.SysBlogExample;
import com.yijianonghu.util.Constants;

import net.javahub.service.BaseService;

@Service
public class RecommendedServicesListService extends BaseService<SysBlog, Integer, SysBlogExample>{
	//首页推荐服务的显示
	public List<SysBlog> getRecommendedServicesListForHomePage() throws ClassNotFoundException, NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException{
		SysBlogExample example=new SysBlogExample();
//		List<Byte> servicesList=new ArrayList<Byte>();
//		servicesList.add((byte) 13);
//		servicesList.add((byte) 14);
		example.createCriteria()
			.andRemoveflagEqualTo((byte)0)
			.andIncludeInWxIsNotNull()
			.andIncludeInWxEqualTo((byte)1)
			.andRecommendInWxIsNotNull()
			.andRecommendInWxEqualTo((byte)1)
			.andTypeIsNotNull()
			.andTypeIn(Constants.WXConstants.WX_SERVICE_TYPES);
		List<SysBlog> recommendedServiceList=selectListByExample(SysBlog.class, example);
		return recommendedServiceList;
	}
}
